
#ifndef _ACTIONPLANE_H__
#define _ACTIONPLANE_H__

#include <QWidgetAction>
#include <QObject>
#include <QList>

#include "RibbonStyleAPI.hpp"
#include "PopupWidget.hpp"

NAMESPACE_BEGIN(NSActionPlane)


class RIBBONSTYLEAPI ActionPlane : public QWidgetAction {
	Q_OBJECT
public:
	explicit ActionPlane(
		QObject* parent, 
		const QStringList& icons, 
		const QStringList& button_texts, 
		const QList<bool>& checkable_list, 
		const QList<bool>& checked_list,
		const QString& caption,
		int type = 0
	);
	~ActionPlane();

public:
	QMap<int, QToolButton*>getButtons() { return toolbtns; }
	QToolButton*getButton(int index) { return toolbtns.value(index); }
	void setPlaneType(int type) { m_type = type; };
	int planeType() { return m_type; };


Q_SIGNALS:
	void moreButtonStateChangeSignal(bool checked);
public Q_SLOT:
	void popupEvent(bool checked);

protected:
	int m_type;
	QWidget* action_widget;
	QToolButton* label_button;
	QToolButton* more_button;
	QMap<int, QToolButton*> toolbtns;
	NSPopupWidget::PopupWidget* popup;
};



NAMESPACE_END

#endif // !_ACTIONPLANE_H__




